package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallCustomer;
import com.appkubes.mall.core.po.MallCustomerExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallCustomerMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCustomerSqlProvider.class, method="countByExample")
    long countByExample(MallCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallCustomerSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_customer",
        "where customer_key = #{customerKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String customerKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_customer (customer_key, app_key, ",
        "nickname, sex, avatar, ",
        "phone, version)",
        "values (#{customerKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{nickname,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{avatar,jdbcType=VARCHAR}, ",
        "#{phone,jdbcType=VARCHAR}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallCustomer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallCustomerSqlProvider.class, method="insertSelective")
    int insertSelective(MallCustomer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCustomerSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="sex", property="sex", jdbcType=JdbcType.VARCHAR),
        @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallCustomer> selectByExampleWithRowbounds(MallCustomerExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCustomerSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="sex", property="sex", jdbcType=JdbcType.VARCHAR),
        @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallCustomer> selectByExample(MallCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "customer_key, app_key, nickname, sex, avatar, phone, version",
        "from mall_customer",
        "where customer_key = #{customerKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="nickname", property="nickname", jdbcType=JdbcType.VARCHAR),
        @Result(column="sex", property="sex", jdbcType=JdbcType.VARCHAR),
        @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR),
        @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallCustomer selectByPrimaryKey(String customerKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCustomerSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallCustomer record, @Param("example") MallCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCustomerSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallCustomer record, @Param("example") MallCustomerExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCustomerSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallCustomer record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer
     *
     * @mbg.generated
     */
    @Update({
        "update mall_customer",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "nickname = #{nickname,jdbcType=VARCHAR},",
          "sex = #{sex,jdbcType=VARCHAR},",
          "avatar = #{avatar,jdbcType=VARCHAR},",
          "phone = #{phone,jdbcType=VARCHAR},",
          "version = #{version,jdbcType=INTEGER}",
        "where customer_key = #{customerKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallCustomer record);
}